package com.mdd.common.mapper.goods;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mdd.common.core.basics.IBaseMapper;
import com.mdd.common.entity.goods.GoodsComment;
import com.mdd.common.entity.order.OrderGoods;
import com.mdd.common.params.comment.CommentListQueryReq;
import com.mdd.common.params.goods.GoodsCommentQueryReq;
import com.mdd.common.vo.goods.GoodsCommentVo;
import com.mdd.common.vo.goods.GoodsDetailCommentVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

@Mapper
public interface GoodsCommentMapper extends IBaseMapper<GoodsComment> {

    /**
     * 查询评论列表pc
     *
     * @param page
     * @param req
     * @return
     */
    IPage<GoodsCommentVo> getListsPc(Page page, @Param("req") GoodsCommentQueryReq req);

    Integer getTotalNum(@Param("req") GoodsCommentQueryReq req);


    /**
     * 小程序查询评论
     *
     * @param page
     * @param req
     * @return
     */
    IPage<OrderGoods> getCommentListApp(Page page, @Param("req") CommentListQueryReq req);

    Integer getTotalNumApp(@Param("req") CommentListQueryReq req);

    GoodsDetailCommentVo getCommentDetailByGoodsId(@Param("goodsId") Integer goodsId);

}
